﻿<%@ Page Language="C#" MasterPageFile="~/second.master" AutoEventWireup="true" CodeFile="index.aspx.cs"
    Inherits="news_index" Title="行业新闻" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headPlaceHolder" runat="Server">
    <link href="../css/jPaginate/css/style.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" runat="Server">
    <div class="mainBar_head">
        <div class="mainBar_title">
            行业新闻
        </div>
        <div class="mainBar_hind">
            <a href="../index.aspx">首页</a>>><a href="index.aspx">行业新闻</a>
        </div>
    </div>
    <div class="mainBar_body">
        <ul id="datalist" class="newsList">
            <%
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    int count = ds.Tables[0].Rows.Count;
                    for (int i = 0; i < count; i++)
                    {
                        System.Data.DataRow row = ds.Tables[0].Rows[i];
                        System.DateTime time = (System.DateTime)row["TIME"];
            %>
            <%
                if (System.DateTime.Now.Subtract(time).Days <= 1)
                {
                   
            %>
            <li>
                <a href="detail.aspx?id=<%=row["ID"] %>"><%=row["NAME"] %>
                    <img src="../img/pic_new.png" /></a>
                <span class="newsdate"><%=time.ToString("yyyy-MM-dd") %></span> </li>
            <%
                }
                else
                {
            %>
            <li>
                <a href="detail.aspx?id=<%=row["ID"] %>"><%=row["NAME"] %></a>
                <span class="newsdate"><%=time.ToString("yyyy-MM-dd") %></span> </li>
            <%
                }
                    }
                }
            %>
        </ul>
        <div class="mainBar_page">
            <div id="pagingDiv">
            </div>
        </div>
    </div>
    <div style="clear: both;">
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="javascriptPlaceHolder" runat="Server">

    <script src="../js/jquery.htmlanimation.js" type="text/javascript"></script>

    <script src="../js/jquery.paginate.js" type="text/javascript"></script>

    <script type="text/javascript">
    jQuery(document).ready(function() {
    $("#pagingDiv").paginate({
				count 		: <%=pageCount %>,
				start 		: <%=page %>,
				display     : 10,
				border					: true,
				border_color			: '#cbccd0',
				text_color  			: '#000000',
				background_color    	: '#ffffff',	
				border_hover_color		: '#ccc',
				text_hover_color  		: '#ffffff',
				background_hover_color	: '#de7a00', 
				images					: false,
				mouse					: 'press',
				onChange     			: function(page){
											window.location.href="index.aspx?page=" + page;
										  }
			});
    
    });

    
    </script>

</asp:Content>
